import React, { useEffect } from "react";
import "../mock/notice";
import axios from "axios";

const App = () => {
  useEffect(() => {
    axios.get("http://10.31.167.36:4000/api/notice/list").then((res) => {
      console.log(res.data);
    });
  }, []);

  const fn = () => {
    axios
      .post("http://10.31.167.36:4000/api/notice/delete", { id: 1 })
      .then((res) => {
        console.log(res.data);
      });
    // axios.post("/api/notice/remove", { id: 1 }).then((res) => {
    //   console.log(res.data);
    // });
  };

  return (
    <div>
      <h2>mock数据</h2>
      <button onClick={fn}>btn</button>
    </div>
  );
};

export default App;
